Skip to content

Fix chat input pushed off-screen on long conversations#58

Merged
CarmenDou merged 1 commit into
mainfrom
fix/chat-input-overflow
Jun 15, 2026
Merged

Fix chat input pushed off-screen on long conversations#58
CarmenDou merged 1 commit into
mainfrom
fix/chat-input-overflow

Conversation

@CarmenDou

@CarmenDou CarmenDou commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Problem

On long conversations (often citation-heavy answers, which tend to be longer), the chat message area grew past the viewport and pushed the ChatInput below the fold — users couldn't see or reach the input box.

Root cause

Classic flexbox min-h-0 trap. The flex chain from the fixed-height root (h-dvh overflow-hidden) down to the scroll container (flex-1 overflow-y-auto) had several intermediate flex items — <main>, <section>, and the messages div — with no min-h-0. A flex item's default min-height: auto refuses to shrink below its content's intrinsic size, so instead of the inner overflow-y-auto engaging, the whole column expanded and shoved the input off-screen.

Fix

  • min-h-0 on <main> and <section> in chat-shell.tsx
  • min-h-0 on the messages scroll container in both app/chat/page.tsx and app/chat/[chatId]/page.tsx
  • shrink-0 on the ChatInput form so it's always pinned and never compressed

5-line change, no behavioral change beyond the scroll fix. Also fixes the CitationRail's own scroll (its aside already had overflow-y-auto but the un-constrained <main> defeated it).

Test plan

  • npm run build
  • Open a chat, send enough messages (or one long citation-heavy answer) to exceed the viewport — message area scrolls, input stays pinned at the bottom and visible
  • Right-side Sources rail scrolls independently when it has many citations
  • Mobile width: input still visible and pinned

🤖 Generated with Claude Code


Summary by cubic

Fixes the chat input being pushed off-screen in long conversations by correcting the flex layout. The message area now scrolls as intended, and the Sources rail scrolls independently.

  • Bug Fixes
    • Added min-h-0 to <main> and <section> in components/chat-shell.tsx.
    • Added min-h-0 to the message containers in app/chat/page.tsx and app/chat/[chatId]/page.tsx.
    • Added shrink-0 to the ChatInput form to keep it pinned.

Written for commit d56dcba. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Re-trigger cubic

@jwfing jwfing left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - approved.

@CarmenDou CarmenDou merged commit 0851c03 into main Jun 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants